package cc.hexie.fish.mapper;

import cc.hexie.fish.pojo.AccountBean;
import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

public class AccountMapper implements RowMapper<AccountBean> {

    @Override
    public AccountBean mapRow(ResultSet resultSet, int i) throws SQLException {
        AccountBean accountBean = new AccountBean();
        accountBean.setId(resultSet.getInt("id"));
        accountBean.setName(resultSet.getString("name"));
        accountBean.setMoney(resultSet.getDouble("money"));
        accountBean.setCreate_time(resultSet.getTimestamp("create_time"));
        accountBean.setLast_modefied(resultSet.getTimestamp("last_modified"));
        return accountBean;
    }
}
